﻿#pragma once

#include "../../Server/MirEnvir/Envir.h"
#include "../../Shared/Data/GuildData.h"
#include <any>
#include "../../stringhelper.h"

using namespace Server::MirEnvir;
using namespace Server::MirObjects;

namespace Server
{
    class GuildInfoForm : public System::Windows::Forms::Form
    {
    public:
        virtual ~GuildInfoForm()
        {
            delete SelectedBuff;
            delete components;
            delete GuildExpratetextBox;
            delete label82;
            delete GuildPPLtextBox;
            delete label81;
            delete GuildMinOwnerLeveltextBox;
            delete label80;
            delete tabControl1;
            delete tabPage1;
            delete tabPage2;
            delete groupBox10;
            delete GuildItemNamecomboBox;
            delete label94;
            delete GuildAmounttextBox;
            delete label93;
            delete GuildDeleteCreateItembutton;
            delete label92;
            delete GuildCreateListcomboBox;
            delete GuildAddCreatItembutton;
            delete label86;
            delete groupBox9;
            delete label84;
            delete label85;
            delete GuildDeleteLevelbutton;
            delete GuildExpNeededtextBox;
            delete GuildAddLevelbutton;
            delete GuildMemberCaptextBox;
            delete label83;
            delete GuildLevelListcomboBox;
            delete tabPage3;
            delete tabPage4;
            delete groupBox1;
            delete WarCostTextBox;
            delete WarLengthTextBox;
            delete label2;
            delete label1;
            delete label4;
            delete label3;
            delete BuffDelete;
            delete BuffAdd;
            delete BuffList;
            delete BuffPanel;
            delete BufflblIndex;
            delete BufftxtName;
            delete label5;
            delete label8;
            delete label7;
            delete label6;
            delete label9;
            delete groupBox2;
            delete label12;
            delete label11;
            delete label10;
            delete label15;
            delete label14;
            delete label13;
            delete label19;
            delete label18;
            delete label17;
            delete label16;
            delete label20;
            delete label21;
            delete label23;
            delete label22;
            delete label24;
            delete label25;
            delete label27;
            delete label26;
            delete BuffTxtLevelReq;
            delete BufftxtActivationCost;
            delete toolTip1;
            delete BufftxtTimeLimit;
            delete BufftxtPointsReq;
            delete BufftxtGoldRate;
            delete BufftxtDropRate;
            delete BufftxtSkillRate;
            delete BufftxtCraftRate;
            delete BufftxtExpRate;
            delete BufftxtFishRate;
            delete BufftxtGemRate;
            delete BufftxtMineRate;
            delete BufftxtMpRegen;
            delete BufftxtHpRegen;
            delete BufftxtMaxMp;
            delete BufftxtMaxHp;
            delete BufftxtAttack;
            delete BufftxtSc;
            delete BufftxtMc;
            delete BufftxtDc;
            delete BufftxtMac;
            delete BufftxtAc;
            delete bufftxtIcon;
            delete label28;
        }

        Server::MirEnvir::Envir *getEnvir() const;

        bool GuildsChanged = false;
    private:
        GuildBuffInfo *SelectedBuff;

    public:
        GuildInfoForm();

    private:
        void GuildInfoForm_FormClosed(std::any sender, FormClosedEventArgs *e);

        void UpdateGuildInterface();

        void GuildMinOwnerLeveltextBox_TextChanged(std::any sender, EventArgs *e);

        void GuildPPLtextBox_TextChanged(std::any sender, EventArgs *e);

        void GuildExpratetextBox_TextChanged(std::any sender, EventArgs *e);

        void GuildCreateListcomboBox_SelectedIndexChanged(std::any sender, EventArgs *e);

        void GuildAddCreatItembutton_Click(std::any sender, EventArgs *e);

        void GuildDeleteCreateItembutton_Click(std::any sender, EventArgs *e);

        void GuildItemNamecomboBox_SelectedIndexChanged(std::any sender, EventArgs *e);

        void GuildAmounttextBox_TextChanged(std::any sender, EventArgs *e);

        void GuildLevelListcomboBox_SelectedIndexChanged(std::any sender, EventArgs *e);

        void GuildAddLevelbutton_Click(std::any sender, EventArgs *e);

        void GuildDeleteLevelbutton_Click(std::any sender, EventArgs *e);

        void GuildExpNeededtextBox_TextChanged(std::any sender, EventArgs *e);

        void GuildMemberCaptextBox_TextChanged(std::any sender, EventArgs *e);


        void WarLengthTextBox_TextChanged(std::any sender, EventArgs *e);

        void WarCostTextBox_TextChanged(std::any sender, EventArgs *e);

        bool IsValid(unsigned char &input, std::any sender);

        bool IsValid(unsigned int &input, std::any sender);

        bool IsValid(int &input, std::any sender);

        void BuffAdd_Click(std::any sender, EventArgs *e);

        void BuffDelete_Click(std::any sender, EventArgs *e);

        void BufftxtName_TextChanged(std::any sender, EventArgs *e);

        void BuffList_SelectedIndexChanged(std::any sender, EventArgs *e);

        void BuffTxtLevelReq_TextChanged(std::any sender, EventArgs *e);

        void BufftxtPointsReq_TextChanged(std::any sender, EventArgs *e);

        void BufftxtTimeLimit_TextChanged(std::any sender, EventArgs *e);

        void BufftxtActivationCost_TextChanged(std::any sender, EventArgs *e);

        void BufftxtAc_TextChanged(std::any sender, EventArgs *e);

        void BufftxtMac_TextChanged(std::any sender, EventArgs *e);

        void BufftxtDc_TextChanged(std::any sender, EventArgs *e);

        void BufftxtMc_TextChanged(std::any sender, EventArgs *e);

        void BufftxtSc_TextChanged(std::any sender, EventArgs *e);

        void BufftxtAttack_TextChanged(std::any sender, EventArgs *e);

        void BufftxtMaxHp_TextChanged(std::any sender, EventArgs *e);

        void BufftxtMaxMp_TextChanged(std::any sender, EventArgs *e);

        void BufftxtHpRegen_TextChanged(std::any sender, EventArgs *e);

        void BufftxtMpRegen_TextChanged(std::any sender, EventArgs *e);

        void BufftxtMineRate_TextChanged(std::any sender, EventArgs *e);

        void BufftxtGemRate_TextChanged(std::any sender, EventArgs *e);

        void BufftxtFishRate_TextChanged(std::any sender, EventArgs *e);

        void BufftxtExpRate_TextChanged(std::any sender, EventArgs *e);

        void BufftxtCraftRate_TextChanged(std::any sender, EventArgs *e);

        void BufftxtSkillRate_TextChanged(std::any sender, EventArgs *e);

        void BufftxtDropRate_TextChanged(std::any sender, EventArgs *e);

        void BufftxtGoldRate_TextChanged(std::any sender, EventArgs *e);

        void bufftxtIcon_TextChanged(std::any sender, EventArgs *e);


        /// <summary>
        /// Required designer variable.
        /// </summary>
        System::ComponentModel::IContainer *components = nullptr;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected:
        void Dispose(bool disposing) override;

        #pragma region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
    private:
        void InitializeComponent();

        #pragma endregion

        System::Windows::Forms::TextBox *GuildExpratetextBox;
        System::Windows::Forms::Label *label82;
        System::Windows::Forms::TextBox *GuildPPLtextBox;
        System::Windows::Forms::Label *label81;
        System::Windows::Forms::TextBox *GuildMinOwnerLeveltextBox;
        System::Windows::Forms::Label *label80;
        System::Windows::Forms::TabControl *tabControl1;
        System::Windows::Forms::TabPage *tabPage1;
        System::Windows::Forms::TabPage *tabPage2;
        System::Windows::Forms::GroupBox *groupBox10;
        System::Windows::Forms::ComboBox *GuildItemNamecomboBox;
        System::Windows::Forms::Label *label94;
        System::Windows::Forms::TextBox *GuildAmounttextBox;
        System::Windows::Forms::Label *label93;
        System::Windows::Forms::Button *GuildDeleteCreateItembutton;
        System::Windows::Forms::Label *label92;
        System::Windows::Forms::ComboBox *GuildCreateListcomboBox;
        System::Windows::Forms::Button *GuildAddCreatItembutton;
        System::Windows::Forms::Label *label86;
        System::Windows::Forms::GroupBox *groupBox9;
        System::Windows::Forms::Label *label84;
        System::Windows::Forms::Label *label85;
        System::Windows::Forms::Button *GuildDeleteLevelbutton;
        System::Windows::Forms::TextBox *GuildExpNeededtextBox;
        System::Windows::Forms::Button *GuildAddLevelbutton;
        System::Windows::Forms::TextBox *GuildMemberCaptextBox;
        System::Windows::Forms::Label *label83;
        System::Windows::Forms::ComboBox *GuildLevelListcomboBox;
        System::Windows::Forms::TabPage *tabPage3;
        System::Windows::Forms::TabPage *tabPage4;
        System::Windows::Forms::GroupBox *groupBox1;
        System::Windows::Forms::TextBox *WarCostTextBox;
        System::Windows::Forms::TextBox *WarLengthTextBox;
        System::Windows::Forms::Label *label2;
        System::Windows::Forms::Label *label1;
        System::Windows::Forms::Label *label4;
        System::Windows::Forms::Label *label3;
        System::Windows::Forms::Button *BuffDelete;
        System::Windows::Forms::Button *BuffAdd;
        System::Windows::Forms::ListBox *BuffList;
        System::Windows::Forms::Panel *BuffPanel;
        System::Windows::Forms::Label *BufflblIndex;
        System::Windows::Forms::TextBox *BufftxtName;
        System::Windows::Forms::Label *label5;
        System::Windows::Forms::Label *label8;
        System::Windows::Forms::Label *label7;
        System::Windows::Forms::Label *label6;
        System::Windows::Forms::Label *label9;
        System::Windows::Forms::GroupBox *groupBox2;
        System::Windows::Forms::Label *label12;
        System::Windows::Forms::Label *label11;
        System::Windows::Forms::Label *label10;
        System::Windows::Forms::Label *label15;
        System::Windows::Forms::Label *label14;
        System::Windows::Forms::Label *label13;
        System::Windows::Forms::Label *label19;
        System::Windows::Forms::Label *label18;
        System::Windows::Forms::Label *label17;
        System::Windows::Forms::Label *label16;
        System::Windows::Forms::Label *label20;
        System::Windows::Forms::Label *label21;
        System::Windows::Forms::Label *label23;
        System::Windows::Forms::Label *label22;
        System::Windows::Forms::Label *label24;
        System::Windows::Forms::Label *label25;
        System::Windows::Forms::Label *label27;
        System::Windows::Forms::Label *label26;
        System::Windows::Forms::TextBox *BuffTxtLevelReq;
        System::Windows::Forms::TextBox *BufftxtActivationCost;
        System::Windows::Forms::ToolTip *toolTip1;
        System::Windows::Forms::TextBox *BufftxtTimeLimit;
        System::Windows::Forms::TextBox *BufftxtPointsReq;
        System::Windows::Forms::TextBox *BufftxtGoldRate;
        System::Windows::Forms::TextBox *BufftxtDropRate;
        System::Windows::Forms::TextBox *BufftxtSkillRate;
        System::Windows::Forms::TextBox *BufftxtCraftRate;
        System::Windows::Forms::TextBox *BufftxtExpRate;
        System::Windows::Forms::TextBox *BufftxtFishRate;
        System::Windows::Forms::TextBox *BufftxtGemRate;
        System::Windows::Forms::TextBox *BufftxtMineRate;
        System::Windows::Forms::TextBox *BufftxtMpRegen;
        System::Windows::Forms::TextBox *BufftxtHpRegen;
        System::Windows::Forms::TextBox *BufftxtMaxMp;
        System::Windows::Forms::TextBox *BufftxtMaxHp;
        System::Windows::Forms::TextBox *BufftxtAttack;
        System::Windows::Forms::TextBox *BufftxtSc;
        System::Windows::Forms::TextBox *BufftxtMc;
        System::Windows::Forms::TextBox *BufftxtDc;
        System::Windows::Forms::TextBox *BufftxtMac;
        System::Windows::Forms::TextBox *BufftxtAc;
        System::Windows::Forms::TextBox *bufftxtIcon;
        System::Windows::Forms::Label *label28;

    };
}
